echo "start hive container..."
docker run -itd --restart=always --net fishbowl --ip 172.16.0.5 --privileged --name hive --hostname hadoop-hive --add-host hadoop-node1:172.16.0.3 --add-host hadoop-node2:172.16.0.4 --add-host hadoop-mysql:172.16.0.6 --add-host hadoop-maste:172.16.0.2 aierwiki/fishbowl /bin/bash

echo "start mysql container ..."
docker run -itd --restart=always --net fishbowl --ip 172.16.0.6 --privileged --name mysql --hostname hadoop-mysql --add-host hadoop-node1:172.16.0.3 --add-host hadoop-node2:172.16.0.4 --add-host hadoop-hive:172.16.0.5 --add-host hadoop-maste:172.16.0.2 aierwiki/fishbowl /bin/bash

echo "start tomcat container ..."
docker run -itd --restart=always --net fishbowl --ip 172.16.0.7 --privileged -p 80:8080 --name tomcat --hostname tomcat --add-host hadoop-mysql:172.16.0.6 aierwiki/fishbowl /bin/bash

echo "start hadoop-maste container ..."
docker run -itd --restart=always --net fishbowl --ip 172.16.0.2 --privileged -p 16666:6666 -p 18032:8032 -p 28080:18080 -p 29888:19888 -p 17077:7077 -p 51070:50070 -p 18888:8888 -p 19000:9000 -p 11100:11000 -p 51030:50030 -p 18050:8050 -p 18081:8081 -p 18900:8900 -p 18088:8088 --name hadoop-maste --hostname hadoop-maste  --add-host hadoop-node1:172.16.0.3 --add-host hadoop-node2:172.16.0.4 --add-host hadoop-hive:172.16.0.5 --add-host hadoop-mysql:172.16.0.6 aierwiki/fishbowl /bin/bash

echo "start hadoop-node1 container..."
docker run -itd --restart=always --net fishbowl  --ip 172.16.0.3 --privileged -p 18042:8042 -p 51010:50010 -p 51020:50020 --name hadoop-node1 --hostname hadoop-node1  --add-host hadoop-hive:172.16.0.5 --add-host hadoop-mysql:172.16.0.6 --add-host hadoop-maste:172.16.0.2 --add-host hadoop-node2:172.16.0.4 aierwiki/fishbowl /bin/bash

echo "start hadoop-node2 container..."
docker run -itd --restart=always --net fishbowl  --ip 172.16.0.4 --privileged -p 18043:8042 -p 51011:50011 -p 51021:50021 --name hadoop-node2 --hostname hadoop-node2 --add-host hadoop-maste:172.16.0.2 --add-host hadoop-node1:172.16.0.3 --add-host hadoop-mysql:172.16.0.6 --add-host hadoop-hive:172.16.0.5 aierwiki/fishbowl /bin/bash


echo start sshd...
docker exec -it hadoop-maste /etc/init.d/ssh start
docker exec -it hadoop-node1 /etc/init.d/ssh start
docker exec -it hadoop-node2 /etc/init.d/ssh start
docker exec -it hive  /etc/init.d/ssh start
docker exec -it mysql /etc/init.d/ssh start

echo start service...
#docker exec -it hadoop-maste  bash -c "sh ~/init_jupyter.sh"
docker exec -it mysql bash -c "sh ~/init_mysql.sh"
docker exec -it hadoop-maste bash -c "sh ~/start-hadoop.sh" 
docker exec -it hive  bash -c "sh ~/init_hive.sh"

#echo start zookeeper...
#docker exec -it hadoop-maste bash -c "bash ~/init_zookeeper.sh"
#docker exec -it hadoop-node1 bash -c "bash ~/init_zookeeper.sh"
#docker exec -it hadoop-node2 bash -c "bash ~/init_zookeeper.sh"

#echo start kafka...
#docker exec -it hadoop-maste bash -c "bash ~/init_kafka.sh"
#docker exec -it hadoop-node1 bash -c "bash ~/init_kafka.sh"
#docker exec -it hadoop-node2 bash -c "bash ~/init_kafka.sh"

#echo start flume...
#docker exec -it tomcat bash -c "sh ~/init_flume.sh"

echo finished
docker ps
